Skip to content

optimize(interleave): implement interleave for FixedSizeList/Map type#10046

Open
mapleFU wants to merge 4 commits into
apache:mainfrom
mapleFU:interleave-fsl-map
Open

optimize(interleave): implement interleave for FixedSizeList/Map type#10046
mapleFU wants to merge 4 commits into
apache:mainfrom
mapleFU:interleave-fsl-map

Conversation

@mapleFU

@mapleFU mapleFU commented Jun 2, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

Rationale for this change

Implement interleave for Map/FSL type.

Note: This might a slow implementation for FSL. For map it's a struct type, and at would have two childs. So even if it's Map<i32, i32>, it wouldn't be slower than before.

For FSL, if it's fixed sized list with short i32 list, it may hit the problem in #10025 , making them use same code to handle list is better.

What changes are included in this PR?

Implement interleave for Map/FSL type.

Are these changes tested?

  1. Test covered by existing
  2. benchmark is provided

Are there any user-facing changes?

No

@github-actions github-actions Bot added the arrow Changes to the arrow crate label Jun 2, 2026
Comment thread arrow-select/src/interleave.rs
("list_view<i64>(0.0,0.0,20)", &list_view_i64_no_nulls),
("list_view_overlapping<i64>(80x,20)", &list_view_overlapping),
("fixed_size_list<i64,5>(0.0,0.0)", &fsl_i64),
("fixed_size_list<i64,5>(0.1,0.1)", &fsl_i64_nulls),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I can also support large fsl, like vector<1024, f32>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know should I extract benchmark to a separate pr ( containing this and concat benchmark?)

@mapleFU

mapleFU commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

Will refactor since #10025 is merged

Ok(Arc::new(array))
}

fn interleave_map(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

map child is always complex type, so doesn't call the primitive fn

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends arrow-select’s interleave kernel to natively support FixedSizeList and Map arrays (previously falling back to the generic implementation), and adds benchmark inputs to measure the new paths.

Changes:

  • Add interleave implementations for FixedSizeList and Map data types in arrow-select
  • Refactor list primitive-child interleave to use the shared ListLikeArray abstraction
  • Add benchmark data generators and new benchmark cases for FixedSizeList<i64> and Map<utf8, i64>

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
arrow/src/util/bench_util.rs Adds benchmark data generators for fixed-size lists and string-keyed maps
arrow/benches/interleave_kernels.rs Adds new benchmark cases for FixedSizeList and Map interleave
arrow-select/src/interleave.rs Implements native interleave for FixedSizeList/Map and refactors list-child interleave via ListLikeArray

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +933 to +937
let mut builder = builder::MapBuilder::new(
None,
builder::StringBuilder::new(),
builder::PrimitiveBuilder::<T>::new(),
);
Comment on lines +894 to +897
let mut rng = seedable_rng();
let list_size_usize = list_size as usize;
let values: PrimitiveArray<T> = (0..size * list_size_usize)
.map(|_| {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: native interleave for fsl/map type

3 participants